package com.bocai.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Random;

/**
 * Created by Cemetery on 2018-04-13.
 */
public class RandomUtils {
    /**
     * 生成16位随机数  13位时间戳+3位随机数+2位订单号
     */
    public static String getOrderNumber() {
        return "BC"+ObjUtils.getNowDate() + "00"+ObjUtils.randomNumeric(7);
//        String timestamp = System.currentTimeMillis() + "";
//        Random ne = new Random();//实例化一个random的对象ne
//        int x = ne.nextInt(999 - 100 + 1) + 100;//为变量赋随机值100-999
//        String random_order = String.valueOf(x);
//        String order_id = timestamp + random_order + orderId;
//        return order_id.substring(0, 18);
    }
}
